package com.zbkj.crmeb.store.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.common.PageParamRequest;
import com.github.pagehelper.PageInfo;
import com.zbkj.crmeb.store.model.ChannelGroupBooking;
import com.zbkj.crmeb.store.request.ChannelGroupBookingRequest;
import com.zbkj.crmeb.store.response.ChannelGroupBookingResponse;
import com.zbkj.crmeb.store.response.StoreProductGroupActivityResponse;

import java.util.List;
import java.util.Map;

public interface ChannelGroupBookingService extends IService<ChannelGroupBooking> {

    /**
     * 功能描述: 保存拼团活动
     * @Param: []
     * @Return: java.lang.Boolean
     * @Author: wangzh
     * @Date: 2022/11/28 16:51
     */
    Boolean saveOrUpdateActivity(ChannelGroupBookingRequest request, Integer merId);

    /**
     * 功能描述: 通过活动id设置活动排序
     * @Param: [activityId, sort]
     * @Return: java.lang.Boolean
     * @Author: wangzh
     * @Date: 2022/11/29 15:24
     */
    Boolean setActivitySort(Integer activityId, Integer sort);

    /**
     * 功能描述: 根据活动名称/活动状态查询活动
     * @Param: [activityName, activityStatus]
     * @Return: com.github.pagehelper.PageInfo<com.zbkj.crmeb.store.response.ChannelGroupBookingResponse>
     * @Author: wangzh
     * @Date: 2022/11/29 15:46
     */
    PageInfo<ChannelGroupBookingResponse> getList(String activityName, Integer activityStatus, String leaderName, PageParamRequest request, Integer merId, String productName);

    /**
     * 功能描述: 通过活动id查询信息
     * @Param: [id]
     * @Return: com.zbkj.crmeb.store.response.ChannelGroupBookingResponse
     * @Author: wangzh
     * @Date: 2022/11/29 18:07
     */
    ChannelGroupBookingResponse getByActivityId(Integer id, Integer merId);

    /**
     * 功能描述: 通过拼团活动的商品id，获取商品详情
     * @Param: [productId]
     * @Return: com.zbkj.crmeb.store.response.StoreProductGroupActivityResponse
     * @Author: wangzh
     * @Date: 2022/11/30 10:37
     */
    StoreProductGroupActivityResponse getProductInfoByProductId(Integer productId, Integer merId, Boolean isApp,String groupId);

    /**
     * 功能描述: 获取在id中的拼团信息
     * @Param: [ids]
     * @Return: java.util.List<com.zbkj.crmeb.store.model.ChannelGroupBooking>
     * @Author: wangzh
     * @Date: 2022/11/30 11:18
     */
    List<ChannelGroupBooking> getGroupBookingInfoInIds(List<Integer> ids);

    /**
     * 功能描述: 删除活动
     * @Param: [activityId]
     * @Return: java.lang.Boolean
     * @Author: wangzh
     * @Date: 2022/11/30 15:32
     */
    Boolean removeActivityByActivityId(Integer activityId, Integer merId);

    /**
     * 功能描述: 提前结束活动
     * @Param: [activityId]
     * @Return: java.lang.Boolean
     * @Author: wangzh
     * @Date: 2022/12/1 16:30
     */
    Boolean earlyTerminationActivity(Integer activityId, Integer merId);

    /**
     * 功能描述: 判断活动是否进行中 true:进行中 false: 结束/未开始
     * @Param: [productId]
     * @Return: java.lang.Boolean
     * @Author: wangzh
     * @Date: 2022/12/1 17:34
     */
    Boolean getActivityIsUnderwayByProductId(Integer productId, List<Integer> ids);

    /**
     * 功能描述: 获取该商户下正在进行的拼团活动id
     * @Param: [merId]
     * @Return: java.util.List<java.lang.Integer>
     * @Author: wangzh
     * @Date: 2022/12/2 11:10
     */
    List<Integer> getInProgressActivityIds(Integer merId);

    List<Integer> getInProgressActivityIdsAndLeaderId(Integer merId,Integer leaderId);

    /**
     * 功能描述: 获取当前商户下活动id
     * @Param: [merId]
     * @Return: java.util.List<java.lang.Integer>
     * @Author: wangzh
     * @Date: 2022/12/14 14:56
     */
    public List<Integer> getActivityIds(Integer merId);

    /**
     * 功能描述: 根据团长id获取团长参与的拼团活动商品id
     * @param leaderId
     * @return
     */
    List<ChannelGroupBookingResponse> getProductByLeaderId(Integer leaderId);

    Integer getLeaderIdByActivityId(Integer id);
}
